package cn.sinonet.mb.processhandler;

import java.util.Map;

import org.limp.basework.AbstractSimpleBean;

/**
 * 报文过程控制器接口抽象实现类
 * <p>
 * 实现过程控制接口时继承此抽象超类,可以实现过程接口配置信息自动加载, 接口实现者只需要完成process方法
 * </p>
 * 
 * @author mido
 * 
 */
public class AbstractMPhandler extends AbstractSimpleBean {
	protected String id;

	protected String name;

	protected String desc;

	protected String params;

	protected Map paramsMap;

	public String getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public String getDesc() {
		return this.desc;
	}

	public String getParams() {
		return this.params;
	}

	public Map getParamsMap() {
		return this.paramsMap;
	}

	public Object getParameter(String key) {
		return this.paramsMap != null && !this.paramsMap.isEmpty() ? this.paramsMap
				.get(key)
				: null;
	}

	public void reload(Map map) {
		if (map != null) {
			this.info = map;

			this.id = (String) this.info.get("");
			this.name = (String) this.info.get("");
			this.desc = (String) this.info.get("");
			this.params = (String) this.info.get("");
		}
	}
}
